package com.example.houduan.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.houduan.entity.Wucp;
import com.example.houduan.mapper.WucpMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WucpService extends ServiceImpl<WucpMapper, Wucp>{

    //获取八条数据
    public List<Wucp> getList() {
        LambdaQueryWrapper<Wucp> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.orderByDesc(Wucp::getId);
        queryWrapper.last("limit 20");
        return this.list(queryWrapper);
    }
}
